<?php
     
//    require 'mysql_db.php';
//    
//    $db = new Db();
//    $cdrs = $db->cdr_read();
//    
//    
//    $cols_captions = array(
//        'cdr_id' => 'ID',
//        'ocg' => 'Calling Party',
//        'ocd' => 'Called Party',
//        'clock_org' => 'Time Originated',
//        'clock_con' => 'Time Connected',
//        'duration' => 'Duration',
//        'money' => 'Cost (EGP)'
//    );
//    
//    $html_cdr_table = "<tr>";
//    foreach ($cols_captions as $col_name=>$col_caption)
//        $html_cdr_table .= "<th>{$col_caption}</th>";
// 
//    $html_cdr_table .= "</tr>";
//    
//    foreach ($cdrs as $cdr){
//        $html_cdr_table .= "<tr>";
//        foreach ($cols_captions as $col_name=>$col_caption){
//            if (strpos($col_name, 'clock') !== FALSE){
//                $human_time = strftime("%c", $cdr[$col_name]);
//                $html_cdr_table .= "<td>$human_time</td>";
//            }
//            elseif (strpos($col_name, 'duration') !== FALSE){
//                $human_interval = gmdate('H:i:s', $cdr[$col_name]);
//                $html_cdr_table .= "<td>$human_interval</td>";
//            }
//            else
//                $html_cdr_table .= "<td>{$cdr[$col_name]}</td>";
//        }
//        $html_cdr_table .= "</tr>";
//    }
    
    $html_template = file_get_contents("t_biller.html");
    
    //$html_cdr_filled = str_replace("%PH_CDRS%", $html_cdr_table, $html_template);
    
    //$html_sidebar = "";
    // form the sidebar
    //$html_page = str_replace("%PH_SIDEBAR%", $html_sidebar, $html_cdr_filled);
    $html_page = $html_template;
    
    echo $html_page; 
    
?>